<template>
  <div>
    <div v-if="!switchOpen">
      <instrument-combination-radio @combSuggestSelection="combSuggestSelection"></instrument-combination-radio>
    </div>
    <div v-if="switchOpen">
      <a-button type="primary" style="margin-bottom: 10px; width: 150px;" @click="switchOpen = false">返回仪器串选择</a-button>
      <InstrumentAssembly :combinationId="combinationId" @getCombination="getCombination"></InstrumentAssembly>
      <!-- <InstrumentInfo :schemesData="props.schemesData" :state="props.state" :reportQuery="reportQuery.reportQuery"></InstrumentInfo> -->
    </div>
  </div>
</template>
<script setup>
import InstrumentAssembly from '@/custom/salvage/components/InstrumentAssembly.vue'
import InstrumentCombinationRadio from "@/custom/preTest/pages/plan/components/instrument/type/CombRadio.vue";
import useApp from "@/hooks";
const props = defineProps({
  combinationId: {
    type: String,
  },
  sOpen: {
    type: Boolean,
  }
});
const { $, proxy } = useApp();
const emit = defineEmits(["getCombId"]);
// const query = ref({ pageNum: 1, pageSize: 10, sortBy: 'id', searchKey: '' });
const combinationId = ref(props.combinationId)
const switchOpen = ref(props.sOpen)

// 添加仪器串组合推荐
function combSuggestSelection(item) {
  console.log('combSuggestSelectio', item);
  combinationId.value = item.id
  switchOpen.value = true
}
function getCombination(e) {
  // 仪器串Id
  emit('getCombId', e)
}
</script>